//
//  WACustomImageVIew.m
//  WalkiOS
//
//  Created by qiaofanglu on 2019/11/8.
//  Copyright © 2019 Chenmuzhou. All rights reserved.
//

#import "WACustomImageVIew.h"

@interface WACustomImageVIew ()

@property (strong, nonatomic) UIActivityIndicatorView *activityView;
@end

@implementation WACustomImageVIew

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self setUpAcitve];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUpAcitve];
    }
    return self;
}

- (void)setUpAcitve{
    self.activityView = [[UIActivityIndicatorView alloc] init];
    [self addSubview:self.activityView];
    [self.activityView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self);
    }];
}

- (void)start{
    self.activityView.hidden = NO;
    [self.activityView startAnimating];
}

- (void)stop{
    self.activityView.hidden = YES;
    [self.activityView stopAnimating];
}
@end
